<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>e8通用后台</title>
    
    <!-- 新 Bootstrap 核心 CSS 文件 -->
      <link rel="stylesheet" href="__PUBLIC__/admin/default/lib/bootstrap/bootstrap.min.css">
	  <link rel="stylesheet" href="__PUBLIC__/admin/default/lib/font-awesome/css/font-awesome.min.css">
    
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <!-- e8 style -->
    <link rel="stylesheet" href="__PUBLIC__/admin/default/css/common.css">
    <link rel="stylesheet" href="__PUBLIC__/admin/default/css/main.css">
    <!-- 加载百度编辑器js -->
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/default/lib/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/default/lib/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/default/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
  </head>
  
  <body>
  
  	<div class="topbar">
    	 <!-- 面包屑 -->
        <include file="./Apps/Admin/View/Include/mbx.html" />
        
        <div class="topbar-search">
        	<form class="form-inline" role="form">
            	<div class="form-group">
            		<label class="sr-only" for="exampleInputEmail2">Email address</label>
            		<input type="email" class="form-control input-sm" id="exampleInputEmail2" placeholder="Enter email">
                    
                    <i class="fa fa-search color-gray"></i>
          		</div>
            </form>
        </div>
    </div><!-- /.topbar -->
    
    <div class="page-content">
    
        <div class="page-header col-sm-12">
        	<h1>栏目修改</h1>
        </div>
        
        
        <div class="col-sm-12">
			<div class="tabbable">
				<ul class="nav nav-tabs">
					<li>
						<a href="__APP__/Class/index">栏目管理</a>
					</li>

					<li>
						<a href="__APP__/Class/add">添加栏目</a>
					</li>
                    
                    <li>
						<a href="__APP__/Class/addlink">添加外部链接栏目</a>
					</li>
				</ul>
				
				<div class="tab-content">
					
					<div class="tab-pane in active">
						<ul class="nav nav-tabs">
                            <li class="active">
                                <a data-toggle="tab" href="#base">基本属性</a>
                            </li>
        
                            <li>
                                <a data-toggle="tab" href="#option">选项设置</a>
                            </li>
                            
                            <li>
                                <a data-toggle="tab" href="#model">模板设置</a>
                            </li>
                            <li>
                                <a data-toggle="tab" href="#content">栏目内容</a>
                            </li>
                             <li>
                                <a data-toggle="tab" href="#perm">权限设置</a>
                            </li>
                        </ul>
                     <form action="__APP__/Class/edit" method="post" enctype="multipart/form-data" enctype="multipart/form-data">
                     	<input type="hidden" name="id" value="{$class.id}"/>
                        <div class="tab-content">
                        <!-- 基本属性开始-->
                         <div id="base" class="tab-pane in active">
                             <p class="title background-blue">基本属性</p>
                            <table width="100%" class="table-form">
                                <tbody>
                                	<tr>
                                        <th width="120">请选择模型</th>
                                        <td>
                                           	 <span class="col-sm-4">
                                                <select class="form-control input-sm" name="modelid">
                                                	<foreach name="modelList" item="model">
                                                 		<option value="{$model.modelid}" {$model.select}>{$model.name}</option>
                                                 	</foreach>
                                                </select>
                                             </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th width="120">上级栏目</th>
                                        <td>
                                           	 <span class="col-sm-4">
                                                <select class="form-control input-sm" name="parentid">
                                                 	<option value="0">==作为一级菜单==</option>
                                                 	<foreach name="classarr" item="classList">
                                                 		<option value="{$classList.id}" {$classList.select}>{$classList.prefix}{$classList.classname}</option>
                                                 	</foreach>
                                                </select>
                                             </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th width="180">类型</th>
                                        <td>
                                         <span class="col-sm-4">
                                        	<if condition="$class.type == 1">
                                        		<input type="radio" value="1" name="type" checked="checked"/>列表栏目（多篇文档的列表栏目）<br/>
                                          		<input type="radio" value="0" name="type"/>频道封面（栏目本身不允许发布文档，可充当"简介"等栏目）
                                          	<else />
                                          		<input type="radio" value="1" name="type"/>列表栏目（多篇文档的列表栏目）<br/>
                                          		<input type="radio" value="0" name="type"  checked="checked"/>频道封面（栏目本身不允许发布文档，可充当"简介"等栏目）
                                        	</if>
                                           
                                         </span>
                                        </td>
                                    </tr>
                                     <tr>
                                        <th>栏目名称</th>
                                        <td>
                                           <span class="col-sm-4"><input type="text" name="classname" value="{$class.classname}" class="form-control input-sm" placeholder="请输入栏目名称"/></span>
                                        </td>
                                    </tr>
                                     <tr>
                                        <th>栏目缩略图</th>
                                        <td>
                                        	 <img class="img-circle" id="photo" src="{$Think.config.UPLOAD_PATH}{$class.image}" alt="{$class.image}" style="width:70px;heihgt:70px;">
                                             <input type="file" name="image"/>
                                        </td>
                                    </tr>
                                   <tr>
                                        <th>栏目简介</th>
                                        <td>
                                            <span class="col-sm-4"><textarea  class="form-control" style="height:90px;" name="introduce">{$class.introduce}</textarea></span>
                                        </td>
                                    </tr>
                                    
                                </tbody>
                            </table>
                            <div style="width:100%;height:60px;"></div>
                            <div class="admin-add">
                            	<button class="btn btn-primary" type="submit">提交</button>
                            </div>
                         </div>
                         <!-- 基本属性结束-->
                                    
                        <!-- 选项设置开始-->
                         <div id="option" class="tab-pane">
                             <p class="title background-blue">选项设置</p>
                            <table width="100%" class="table-form">
                                <tbody>
                                	<tr>
                                        <th width="180">是否在导航显示</th>
                                        <td>
                                         <span class="col-sm-4">
                                        	 <if condition="$class.isnav == 1">
	                                           <input type="radio" value="1" name="isnav"  checked="checked"/>在导航显示
	                                           <input type="radio" value="0" name="isnav"/>不在导航显示
	                                         <else/>
	                                         	<input type="radio" value="1" name="isnav"/>在导航显示
	                                            <input type="radio" value="0" name="isnav"   checked="checked"/>不在导航显示
	                                         </if>
                                         </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>显示排序</th>
                                        <td>
                                           	  <span class="col-sm-1"><input type="text" class="form-control input-sm" name="sort" value="{$class.sort}"/></span>
                                        </td>
                                    </tr>
                                     <tr>
                                        <th>SEO标题</th>
                                        <td>
                                           <span class="col-sm-4"><input type="text" name="seo_title" class="form-control input-sm" placeholder="请输入SEO标题" value="{$class.seo_title}"/></span>
                                        </td>
                                    </tr>
                                     <tr>
                                        <th>SEO关键（关键字中间用半角逗号隔开）字</th>
                                        <td>
                                             <span class="col-sm-4"><textarea class="form-control" style="height:60px;" name="keywords">{$class.keywords}</textarea></span>
                                        </td>
                                    </tr>
                                   <tr>
                                        <th>SEO描述</th>
                                        <td>
                                              <span class="col-sm-4"><textarea class="form-control" style="height:60px;" name="description">{$class.description}</textarea></span>
                                        </td>
                                    </tr>
                                    
                                </tbody>
                            </table>
                            <div style="width:100%;height:60px;"></div>
                            <div class="admin-add">
                            	<button class="btn btn-primary" type="submit">提交</button>
                            </div>
                         </div>
                       <!-- 选项设置结束-->
                       
                         <!-- 模板设置开始-->
                         <div id="model" class="tab-pane">
                             <p class="title background-blue">模板设置</p>
                                <table width="100%" class="table-form">
                                    <tbody>
                                        <tr>
                                            <th width="160">栏目首页模板</th>
                                            <td>
                                                 <span class="col-sm-4">
                                                    <select class="form-control input-sm" name="index_template">
                                                    	<foreach name="indexTemplateList" item="indexTemplate">
                                                        	<option value="{$indexTemplate.id}" {$indexTemplate.select}>{$indexTemplate.name}</option>
                                                        </foreach>
                                                    </select>
                                                 </span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th width="120">栏目内容模板</th>
                                            <td>
                                                 <span class="col-sm-4">
                                                    <select class="form-control input-sm" name="content_template">
                                                   		<foreach name="contentTemplateList" item="contentTemplate">
                                                        	<option value="{$contentTemplate.id}"  {$contentTemplate.select}>{$contentTemplate.name}</option>
                                                        </foreach>                                             
                                                    </select>
                                                 </span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            <div style="width:100%;height:60px;"></div>
                            <div class="admin-add">
                            	<button class="btn btn-primary" type="submit">提交</button>
                            </div>
                         </div>
                       <!-- 模板设置结束-->
                       
                       <!-- 内容设置开始-->
                         <div id="content" class="tab-pane">
                             <p class="title background-blue">栏目内容</p>
				                   <div class="wid-100">
				                        <script id="editor" type="text/plain" style="width:100%;height:300px;" name="content">{$class.content}</script>
				                   </div>
				            <div style="width:100%;height:60px;"></div>
                            <div class="admin-add">
                            	<button class="btn btn-primary" type="submit">提交</button>
                            </div>
                         </div>
                       <!-- 内容设置结束-->
                       
                         <!-- 权限设置开始-->
                         <div id="perm" class="tab-pane">
                            <p class="title background-blue">权限设置</p>
                                <table width="100%" class="table-form">
                                    <tbody>
                                    	 <tr>
                                            <th width="200">角色权限</th>
                                            <td>
                                                 <span class="col-sm-4">
                                                    <div class="perm">
                                                    	<dl>
                                                        	<foreach name="roleList" item="role">
                                                        	<dt>
                                                               {$role.name}
                                                            </dt>
                                                            <if condition="$role.parentid == 0">
                                                            	 <dd>
	                                                                <input  type="checkbox" value="index" name="{$role.id}[]" checked="checked" disabled="disabled">查看已审核文章
	                                                                <input  type="checkbox" value="check" name="{$role.id}[]" checked="checked" disabled="disabled">查看未审核文章 
	                                                                <input  type="checkbox" value="restore" name="{$role.id}[]" checked="checked" disabled="disabled">查看回收站文章
	                                                                <input  type="checkbox" value="add" name="{$role.id}[]" checked="checked" disabled="disabled">添加
	                                                                <input  type="checkbox" value="edit" name="{$role.id}[]" checked="checked" disabled="disabled">修改  
	                                                                <input  type="checkbox" value="remove" name="{$role.id}[]" checked="checked" disabled="disabled">删除
	                                                                <input  type="checkbox" value="renew" name="{$role.id}[]" checked="checked" disabled="disabled">还原
	                                                                <input  type="checkbox" value="del" name="{$role.id}[]" checked="checked" disabled="disabled">永久删除
	                                                                <input  type="checkbox" value="checkout" name="{$role.id}[]" checked="checked" disabled="disabled">审核  
	                                                                <input  type="checkbox" value="cancelcheck" name="{$role.id}[]" checked="checked" disabled="disabled">取消审核  
	                                                                <input  type="checkbox" value="sort" name="{$role.id}[]" checked="checked" disabled="disabled">排序								                       			                                          		                         										
	                                                            </dd> 
                                                            <else/>
	                                                            <dd>
	                                                            	<foreach name="classpermList[$key]" item="classperm">
	                                                             		<input type="checkbox" value="{$classperm.action}" name="{$role.id}[]" {$classperm.check}>{$classperm.name} 
	                                                                </foreach>        		                         										
	                                                            </dd>
                                                            </if>
                                                         </foreach>
                                                        </dl>
                                                    </div>
                                                 </span>
                                            </td>
                                       </tr>
                                    </tbody>
                                </table>
                                 <div style="width:100%;height:60px;"></div>
                                 <div class="admin-add">
                                    <button class="btn btn-primary btn-sm" type="submit">提交</button>
                                 </div>
                         </div>
                       <!-- 权限设置结束-->
                        </div>
                        </form>
                    </div>
				</div>
			</div>
		</div><!-- /span -->
        
    </div><!-- /.page-content -->
    <!-- 图片弹出层 -->
    <div id="outerdiv"
        style="position: fixed; top: 0; left: 0; background: rgba(0, 0, 0, 0.7); z-index: 10000; width: 100%; height: 100%; display: none;">
        <div id="innerdiv" style="position: absolute;">
          <img id="bigimg" style="border: 5px solid #fff;" src="" />
        </div>
    </div>
  	<!-- jQuery文件 -->
	<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <!-- jQuery-ui 文件 -->
    <script src="http://libs.baidu.com/jqueryui/1.10.2/jquery-ui.min.js "></script>
    <!-- Bootstrap 核心 JavaScript 文件 -->
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script>
	$(document).ready(function(){
    	//实例化编辑器
    	var ue = UE.getEditor('editor');
	})
  	</script>
    <!-- jQuery文件 -->
	<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="__PUBLIC__/admin/default/lib/bootstrap/bootstrap.min.js"></script>
    <!--  -->
	<script src="__PUBLIC__/admin/default/js/e8.js"></script>
	<script src="__PUBLIC__/admin/default/js/fun.js"></script>
    <script>
    $(document).ready(function() { 
        $("#photo").click(function(){
            var _this = $(this);//将当前的元素作为_this传入函数
            imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
        });
    });
    </script>
  </body>
</html>
